var mix = (function (mix) {
    
mix.point2d = {};
var point2d = mix.point2d;
    
var Point2D = function ( x, y) {
	this.x = x;
	this.y = y;
}

Point2D.prototype = {
    add : function( p) {
	    return new Point2D( this.x + p.x, this.y + p.y);
    },

    sub : function( p) {
	    return mix.vector2d.create( this.x - p.x, this.y - p.y);
    },

    mul : function( s) {
	    return new Point2D( this.x * s, this.y *s);
    },
}

point2d.create = function( x, y) {
    return new Point2D( x, y);
}

point2d.lerp = function ( p1, p2, t) {
	var r = p2.sub( p1);
	r.x *= t;
	r.y *= t;
	r.x += p1.x;
	r.y += p1.y;
	return r;
}

point2d.length = function ( p1, p2) {
    var dx = p2.x - p1.x;
    var dy = p2.y - p1.y;
	return Math.sqrt( dx * dx, dy * dy);
}

return mix;     
      
      
}(mix || {}));